<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="cn.com.zzz.pk.dto.PkRoom"%>
<%@page import="cn.bbs.ba.html.ZPaiInit"%>
<%@page import="cn.bbs.ba.db.Fetcher"%>
<%@ include file="../../head.jsp"%>

<html>
<head>
<link rel="stylesheet" href="<%=webBackPath %>css/common.css" type="text/css"/>
<script type="text/javascript" src="<%=webBackPath %>js/calendar.js"></script> 
<script type="text/javascript" src="<%=webBackPath %>js/lib/public.js"></script>
<script type="text/javascript" src="<%=webBackPath %>js/prototype-1.6.0.3.js"></script> 
<script type="text/javascript" src="<%=webBackPath %>js/jquery-1.4.2.min.js"></script> 
<script type="text/javascript" src="<%=webBackPath %>js/json.js"></script> 
<script type="text/javascript" src="<%=webBackPath %>js/lib/public.js"></script> 
<script type="text/javascript" src="<%=webBackPath %>js/lib/md5.js"></script> 
<script language='javascript'>
var nowDate = getAfterDay(0);
var error_1 = 9;
function checkData(form) {
	if (isEmpty(form.userName.value)) {
		alertPP("用户名不能为空");
		return false;
	}
	
	if(error_1 == 1) {
		alertPP("用户已经存在，请使用别的用户名！");
		return false;
	}
	if (!validate_email(form.email.value)) {
		alertPP("email输入不正确");
		form.email.focus();
		return false;
	}

	if (isEmpty(form.answer.value)) {
		
		alertPP("密码答案不能为空");
		form.answer.focus();
		return false;
	}
	
	if (isEmpty(form.openMoney.value)) {
		
		alertPP("开户金额不能为空");
		form.openMoney.focus();
		return false;
	}
	if (isMoney(form.openMoney.value)) {
		
		alertPP("开户金额输入的不是金额");
		form.openMoney.focus();
		return false;
	}
	form.PASSPORT.value = hex_md5(form.PASSPORT.value);
	return true;
}
function changeDate() {
	document.getElementById("openDate").value = getAfterDay(0);
	document.getElementById("endDate").value = getAfterDay(eval("yxdate.A" + document.getElementById("kbn").value));
}

var xmlHttpUserName;
function checkUserEx(userName) {
	//alert("getGiftFromServermin");
	var url = "ajaxCommon.pk?alias=" + userName + "&type=checkUserName";
	//alert(url);
	if (window.ActiveXObject) {
		xmlHttpUserName = new ActiveXObject("Microsoft.XMLHTTP");
	}else if (window.XMLHttpRequest) {
		xmlHttpUserName = new XMLHttpRequest();
	}

	xmlHttpUserName.onreadystatechange = funCheckUserEx;
	
	xmlHttpUserName.open("GET", url, true);
	xmlHttpUserName.send(null);
}
function funCheckUserEx() {

	if (xmlHttpUserName.readyState == 4 || xmlHttpUserName.readyState == "complete") {
		var msg = xmlHttpUserName.responseText
		if (msg != "success") {
            error_1 = 1;
            alertPP("用户已经存在，请使用别的用户名！");
		}
		else {
            error_1 = 9;
		}
	}
}

</script>
</head>
<body>

<div id="man_zone">
   <table width="99%" border="1" align="center"  cellpadding="3" cellspacing="1">
		<tr class="list_tilte_table" style="text-align: center;">
	      <td><bbsh:BBSH name="房间号码"/></td>
	      <td><bbsh:BBSH name="房间名称"/></td>
	      <td><bbsh:BBSH name="父房间号码"/></td>
	      <td><bbsh:BBSH name="最多带入钱数"/></td>
	      <td><bbsh:BBSH name="最少带入钱数"/></td>
	      <td><bbsh:BBSH name="备注"/></td>
	      <td><bbsh:BBSH name="状态"/></td>
	      <td><bbsh:BBSH name="操作"/></td>
	    </tr>
	        <% 
	        Fetcher<PkRoom> rooomList = (Fetcher<PkRoom>)request.getAttribute("roomList");
	        for (int i = 1; i <= rooomList.size(); i++) {
    			PkRoom room = rooomList.get(i);
    			// 状态 1：有效 0： 无效
    			String stt = "有效";
    			if ("0".equals(room.getRoomStt())) {
    				stt = "无效";
    			}
     	%>
	    <tr style="text-align: center;">
	      <td><%=room.getRoomId() %></td>
	      <td><%=room.getRoomName() %></td>
	      <td><%=room.getParentid() %></td>
	      <td><%=room.getZddrqs() %></td>
	      <td><%=room.getZsdrqs() %></td>
	      <td><%=room.getRemarks() %></td>
	      <td><%=stt %></td>
	      <td><a href="javascript:deleteByAccNo('<%=room.getRoomId() %>');"><bbsh:BBSH name="删除"/></a></td>
	    </tr>
  	  <% } %>
  </table>
</div>
</body>
</html>
